1. Field of the Invention
The present invention relates to an image processing apparatus, a control method of an image processing apparatus, and a storage medium.
2. Description of the Related Art
A Document reading apparatus in digital copying machines uses a charge-coupled device (CCD) image sensor or a complementary metal oxide semiconductor (CMOS) image sensor. In the reading apparatus uses a CCD or a CMOS to read image data, the reading apparatus includes following configurations to realize a magnification function of enlarging/reducing read images.
More specifically, the magnification in the main-scanning direction is changed by executing arithmetic processing on a digital signal, and the magnification in the sub-scanning direction is changed by changing the reading speed and changing the number of read lines.
Alternatively, to change a magnification, a control unit in a reading apparatus or a main body executes arithmetic processing (image processing) on image data. In addition, many digital copying machines include a reading apparatus including an automatic document feeder (ADF). The ADF has a mechanism of automatically feeding documents placed on a document stacking tray one by one to the reading apparatus, so that the reading apparatus can read the fed documents one by one.
A document fed by such an ADF can be read in a document fixed-reading mode or in a document feeding-reading mode. In the former case, first, a document is fed onto the contact glass, and next, an image of the fed document is read by movement of a scanner unit. In the latter case, the image of a document is read while the ADF is feeding the document.
Unlike in the document fixed-reading mode, the scanner does not need to move to read every single document in the document feeding-reading mode. Thus, the document feeding-reading mode requires less time to read the entire document stack, and therefore the size of the ADF can be reduced.
In addition, a function of the digital copying machine includes an automatic magnification function to calculate a magnification ratio based on a document size and an output sheet size and to form an image. This automatic magnification function calculates an optimum magnification ratio for a read image, based on a document size automatically detected by a document size detection function included in the reader apparatus and based on an output sheet size selected by a user. The automatic magnification function then processes the image with the calculated magnification ratio.
To realize this automatic magnification function, before the document is read, the document size needs to be detected and the magnification ratio needs to be determined. In one method of detecting the document size, sensors arranged on the document stacking tray are used.
The size in a direction perpendicular to the document conveyance direction can be detected by causing a sensor to read the width of a guiding member defining the width of the top and bottom parts of a document on the document stacking tray. In another example, the size can be detected by a plurality of sensors arranged in the document conveyance direction.
In one method of detecting the length of a document in the conveyance direction, the length is detected based on a combination of timings when the document passes through a sensor arranged on the document stacking tray. In another method of detecting the length of a document, a detection sensor is arranged along the document conveyance path, and the document position or the time required from when the document leading edge passes through the detection sensor to when the document trailing edge passes through the document sensor is detected by the detection sensor.
As a problem with the former method, in a document size mixed mode where documents of different sizes are collectively set and read, regarding the size in the conveyance direction, a document size having a length smaller than a maximum length among the set documents cannot be detected on the document platen. Thus, the digital copying machine with such a document size mixed mode uses a combination of the former and latter methods to detect the document size.
However, in the document size mixed mode based on the latter method, the document size is determined only when a single document is removed and conveyed from a document stack on the document stacking tray and the document is completely separated from the other sheets.
Thus, a document conveyance path allowing this operation needs to be ensured. This size detection is possible in the case of the document fixed-reading mode where a document is fed onto the contact glass and an image of the fed document is read by the movement of a scanner. To realize the same operation in the document feeding-reading mode, since the document conveyance path needs to be ensured, the size of the ADF needs to be increased, which is undesirable
In one method of ensuring the document conveyance path, a document inversion mechanism to read a two-sided document is used. This method includes a step of detecting the document size without reading the document. After the document size is determined in this step, the document is conveyed to the document reading position again to be read.
However, based on this method, the document needs to be conveyed a plurality of times along the document conveyance path for two sides, resulting in a significant decrease in productivity of the copying process. In addition, a reading apparatus having a two-sided simultaneous reading mechanism that can read both front and back sides of a document in a single document conveyance pass cannot adopt this method.
As a conventional technique, Japanese Patent Laid-Open No. 2004-104187 discusses a method to solve this problem. Based on this method, when the document size is not determined before image reading, read image data is stored in a memory, and after the document size is detected and determined, magnification is executed by image processing (arithmetic processing).
Based on the technique discussed in Japanese Patent Laid-Open No. 2004-104187, read image data needs to be stored in a memory until the document size is determined. Thus, the reading apparatus needs to have a large memory capacity.
In particular, since a reading apparatus having a two-sided simultaneous reading mechanism executes magnification processing on the back side after completion of magnification processing on the front side, the reading apparatus needs a memory capable of storing both front- and back-side data. Since the reading apparatus needs memory capacity corresponding to two pages of a maximum readable document size, memory costs are increased, which is undesirable.
In addition, a digital copying machine copies a document by causing a reading apparatus to read image data and to transfer the read image data to a control apparatus of a main body, causing the control apparatus to execute image processing on the image data and to transfer the processed image data to a printer apparatus, and causing the printer apparatus to print the image data. After the reading apparatus transfers image data to the control apparatus, the control apparatus executes image processing on the image data, and stores the processed image data in a memory of the control apparatus.
In particular, in digital copying machines having a control apparatus that can execute a magnification process as image processing, to realize a desired magnification process, some of the copying machines cause a reader unit and a control apparatus to execute different magnification processes.
For these digital copying machines, to execute a magnification process and other image processing, a read image size and an output image size determined based on the image size need to be determined, and setting of image processing needs to be executed in advance by using these values.
However, these image size values cannot be determined unless the document size is determined. In the document size mixed mode, setting of image processing cannot be executed before the document is read.
In addition, a certain period of time is required to execute setting of image processing in the control apparatus. Thus, if read image data is stored in a memory of the reading apparatus until the document size is determined, the read image data needs to be stored in a memory of the reader apparatus from when the document size is determined until when the control apparatus is ready to start processing the image data.
In particular, if the time required by the control apparatus to execute setting of image processing is not constant, the worst case needs to be considered. That is, a memory of the reading apparatus needs to have a memory capacity capable of storing the entire document image. In this respect, too, memory costs are increased, which is a significant problem.